<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>测试一些css的小技巧</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/cssReset.css" />
		<link rel="stylesheet" type="text/css" href="css/css_jiqiao.css" />
	</head>

	<body>
		<input type="number" name="" id="" value="" />
		<h1>CSS的一些小技巧</h1>
		<img class="img_one" src="img/1.jpg" />
		<ul class="ul_one">
			<li class="small_li"></li>
			<li class="big_li"></li>

		</ul>
		<div id="box">
			<div class="s_box">

			</div>
		</div>
	</body>
	<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<script type="text/javascript">
		$(".small_li").on("click", function() {
			alert(1);
		})

		function red() {
			console.log('red');
		}

		function green() {
			console.log('green');
		}

		function yellow() {
			console.log('yellow');
		}

		var light = function(timmer, cb) {
			return new Promise(function(resolve, reject) {
				setTimeout(function() {
					cb();
					resolve();
				}, timmer);
			});
		};

		var step = function() {
			Promise.resolve().then(function() {
				return light(3000, red);
			}).then(function() {
				return light(2000, green);
			}).then(function() {
				return light(1000, yellow);
			}).then(function() {
				step();
			});
		}

		//step();
		// map方法 映射
		// map方法和forEach很像， 要求每个函数都返回一个结果， 得到一个新数组
		// var arr = [1, 2, 3, 4]
		// // 要求： 给数组的每一项都求平方 [1, 4, 9, 16]
		// let newArr = arr.map(function(item, index) {
		// return item * item
		// })
		// console.log(newArr)

		//var cheng = {
		//	"name":"cheng",
		//	"age":12
		//}
		//var zhan = {};
		//cheng.sex = zhan = {"sex":"meal"};
		//console.log(cheng);
		//console.log(zhan);

		var a, b, c = "";
		a = b = c = [1, 2, 3];
		console.log(a, b, c);
		a.push(4);
		console.log(a, b, c);
		console.log(new Date());
		console.log(new Date().setHours(9,0,0,0));
	</script>

</html>